package com.springfairytale.qqserver.data;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import com.springfairytale.qqserver.entity.User;

public class Data {

	public static void main(String[] args) throws IOException,
			IllegalArgumentException, IllegalAccessException {
		String v = Data.class.getClassLoader().getResource("").getPath();
		FileOutputStream out = new FileOutputStream(v + "\\users.xml");

		List<Object> list = new ArrayList<Object>();
		User u1 = new User("936968862", "123456", "BaiJuyi", "no pic", 0,
				"19900301", "Harbin", "Hello Harbin",0);
		User u2 = new User("3167689990", "123456", "HeYuting", "no pic", 1,
				"19901031", "Shenyang", "Hello Shenyang",0);
		User u3 = new User("549763243", "123456", "YuHuaqiu", "no pic", 0,
				"19901111", "Puyang", "Hello Puyang",0);
		User u4 = new User("944500722", "123456", "Liuwenyang", "no pic", 0,
				"19901231", "Heihe", "Hello Heihe",0);
		User u5 = new User("635038685", "123456", "LiangJingfang", "no pic", 1,
				"1994525", "Chifeng", "Hello Chifeng",0);

		list.add(u1);
		list.add(u2);
		list.add(u3);
		list.add(u4);
		list.add(u5);

		XmlUtil.writeXml("users", list, out);
	}
}
